Clover coverage report - Enterprise Web Services - 1.0
Coverage timestamp: Mon May 30 2005 17:10:32 CEST
file stats: LOC: 157   Methods: 19
NCLOC: 84   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
J2EEWebServiceContextImpl.java 50% 81.8% 84.2% 81.4%
coverage coverage
 1   
 /*
 2   
  * Copyright 2001-2004 The Apache Software Foundation.
 3   
  * 
 4   
  * Licensed under the Apache License, Version 2.0 (the "License");
 5   
  * you may not use this file except in compliance with the License.
 6   
  * You may obtain a copy of the License at
 7   
  * 
 8   
  *      http://www.apache.org/licenses/LICENSE-2.0
 9   
  * 
 10   
  * Unless required by applicable law or agreed to in writing, software
 11   
  * distributed under the License is distributed on an "AS IS" BASIS,
 12   
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13   
  * See the License for the specific language governing permissions and
 14   
  * limitations under the License.
 15   
  */
 16   
 
 17   
 package org.apache.geronimo.ews.ws4j2ee.context.impl;
 18   
 
 19   
 import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
 20   
 import org.apache.geronimo.ews.ws4j2ee.context.JaxRpcMapperContext;
 21   
 import org.apache.geronimo.ews.ws4j2ee.context.MiscInfo;
 22   
 import org.apache.geronimo.ews.ws4j2ee.context.j2eeDD.EJBContext;
 23   
 import org.apache.geronimo.ews.ws4j2ee.context.j2eeDD.WebContext;
 24   
 import org.apache.geronimo.ews.ws4j2ee.context.webservices.client.interfaces.ServiceReferanceContext;
 25   
 import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFContext;
 26   
 import org.apache.geronimo.ews.ws4j2ee.context.wsdl.WSDLContext;
 27   
 import org.apache.geronimo.ews.ws4j2ee.toWs.UnrecoverableGenerationFault;
 28   
 import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2eeFactory;
 29   
 
 30   
 import java.util.Vector;
 31   
 
 32   
 /**
 33   
  * <p>Code should use parsers and create runtime representation
 34   
  * of the information taken fom the WSDL and configaration files.</p>
 35   
  * <p>depend on hasWSDL or the not the implementation should
 36   
  * <ol>
 37   
  * <li>parse the WSDL and populate informatio in <code>WSDLContext</code></li>
 38   
  * <li>parse the SEI or EJB and populate the information in <code>WSDLContext</code>
 39   
  * with the help of the jaxrpc mapping file information.
 40   
  * </li>
 41   
  * </ol>
 42   
  * </p>
 43   
  *
 44   
  * @author Srinath Perera(hemapani@opensorce.lk)
 45   
  * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext
 46   
  */
 47   
 public class J2EEWebServiceContextImpl implements J2EEWebServiceContext {
 48   
     private boolean hasWSDL = true;
 49   
     private WSCFContext wscfcontext;
 50   
     private WSDLContext wsdlcontext;
 51   
     private JaxRpcMapperContext jaxrpcmappingcontext;
 52   
     private MiscInfo miscInfo;
 53   
     private Ws4J2eeFactory factory;
 54   
     private Vector srcontext;
 55   
     private EJBContext ejbcontext;
 56   
     private WebContext webcontext;
 57   
 
 58  18
     public J2EEWebServiceContextImpl(boolean hasWSDL) {
 59  18
         this.hasWSDL = hasWSDL;
 60  18
         srcontext = new Vector();
 61   
     }
 62   
 
 63   
     /* (non-Javadoc)
 64   
      * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext#getWSDLContext()
 65   
      */
 66  279
     public WSDLContext getWSDLContext() {
 67  279
         return wsdlcontext;
 68   
     }
 69   
 
 70   
     /* (non-Javadoc)
 71   
      * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext#setWSDLContext(org.apache.geronimo.ews.ws4j2ee.context.wsdl.WSDLContext)
 72   
      */
 73  27
     public void setWSDLContext(WSDLContext wsdlcontext) {
 74  27
         this.wsdlcontext = wsdlcontext;
 75   
     }
 76   
 
 77   
     /* (non-Javadoc)
 78   
      * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext#getJAXRPCMappingContext()
 79   
      */
 80  156
     public JaxRpcMapperContext getJAXRPCMappingContext() {
 81  156
         return jaxrpcmappingcontext;
 82   
     }
 83   
 
 84   
     /* (non-Javadoc)
 85   
      * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext#setJAXRPCMappingContext(org.apache.geronimo.ews.ws4j2ee.context.JaxRpcMapperContext)
 86   
      */
 87  27
     public void setJAXRPCMappingContext(JaxRpcMapperContext context) {
 88  27
         this.jaxrpcmappingcontext = context;
 89   
     }
 90   
 
 91  112
     public WSCFContext getWSCFContext() {
 92  112
         return wscfcontext;
 93   
     }
 94   
 
 95   
     /* (non-Javadoc)
 96   
      * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext#setWSCFContext(org.apache.geronimo.ews.ws4j2ee.context.webservices.interfaces.WSCFContext)
 97   
      */
 98  11
     public void setWSCFContext(WSCFContext wscfcontext) {
 99  11
         this.wscfcontext = wscfcontext;
 100   
     }
 101   
 
 102  785
     public MiscInfo getMiscInfo() {
 103  785
         return miscInfo;
 104   
     }
 105   
 
 106   
     /**
 107   
      * @param info
 108   
      */
 109  18
     public void setMiscInfo(MiscInfo info) {
 110  18
         this.miscInfo = info;
 111   
     }
 112   
 
 113  11
     public void validate() {
 114  11
         if (wscfcontext == null || miscInfo == null ||
 115   
                 (hasWSDL && wsdlcontext == null) || jaxrpcmappingcontext == null)
 116  0
             throw new UnrecoverableGenerationFault("valdation of the j2ee context failed");
 117  11
         miscInfo.validate();
 118   
     }
 119   
 
 120  15
     public void setFactory(Ws4J2eeFactory factory) {
 121  15
         this.factory = factory;
 122   
     }
 123   
 
 124  34
     public Ws4J2eeFactory getFactory() {
 125  34
         return this.factory;
 126   
     }
 127   
 
 128  0
     public void addServiceReferanceContext(ServiceReferanceContext context) {
 129  0
         srcontext.add(context);
 130   
     }
 131   
 
 132  43
     public EJBContext getEJBDDContext() {
 133  43
         return ejbcontext;
 134   
     }
 135   
 
 136  0
     public ServiceReferanceContext getServiceReferanceContext(int index) {
 137  0
         return (ServiceReferanceContext) srcontext.get(index);
 138   
     }
 139   
 
 140  0
     public int getServiceReferanceContextCount() {
 141  0
         return srcontext.size();
 142   
     }
 143   
 
 144  4
     public WebContext getWebDDContext() {
 145  4
         return webcontext;
 146   
     }
 147   
 
 148  8
     public void setEJBDDContext(EJBContext context) {
 149  8
         this.ejbcontext = context;
 150   
     }
 151   
 
 152  3
     public void setWebDDContext(WebContext context) {
 153  3
         webcontext = context;
 154   
     }
 155   
 
 156   
 }
 157